package edu.ucsc.mit2008.swan.editor.coreUI.internal.dialog;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

/**
 * Dialog to show the help.
 * 
 * 
 * @author Thushara Sanjeewa Ramasinghe
 * 
 */
public class AboutUsDialog extends Dialog {

	/**
	 * Constructor.
	 * 
	 * @param shell
	 */
	public AboutUsDialog(Shell shell) {
		super(shell);
		setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER
				| SWT.APPLICATION_MODAL | SWT.RESIZE | getDefaultOrientation());
	}

	/**
	 * {@inheritDoc}
	 */
	protected void configureShell(Shell shell) {
		super.configureShell(shell);
		shell.setText("About Us");
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	protected Control createDialogArea(Composite parent) {
		Composite dialogAreaComposite = new Composite(parent, SWT.NONE);
		GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).hint(400, 200)
				.grab(true, true).applyTo(dialogAreaComposite);
		GridLayoutFactory.fillDefaults().applyTo(dialogAreaComposite);
		Label label = new Label(dialogAreaComposite, SWT.NONE);
		GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
				true).applyTo(label);
		label.setText("Swan Image Presenter.");
		return dialogAreaComposite;
	}

}
